{extend name="platform/base" /}
{block name="resources"}
<style>
.right-indent:after{
	content:'';
	display:inline-block;
	width:40%;
}
</style>
{/block}
{block name="main"}

 <div class="row padder-v">
            <div class="col-sm-9">
              	   <a class="btn btn-sm btn-primary" href="{:__URL('PLATFORM_MAIN/shop/addGuide')}" ><i class="fa fa-plus"></i>&nbsp;添加指南</a>
            </div>
 </div>
<section class="panel panel-default">
       <div class="table-responsive">
            <table  class="table table-striped b-light text-sm">
            	<colgroup>
				<col width="3%">
				<col width="30%">
				<col width="25%">
				<col width="12%">
				<col width="30%">
				</colgroup>
				 <thead>
				 <tr>
                    <th class="center"><input type="checkbox"></th>
                    <th class="right right-indent">排序</th>
                    <th class="left">标题</th>
                    <th></th>
                    <th class="center">操作</th>
				 </tr>
				 <tbody id="list">
				    <tr></tr>
				 </tbody>
			</table>
       </div>
              {include file="platform/page" /}
</section>

{/block}
{block name="script"}
<script type="text/javascript">
//分页数据
$(function(){
	LoadingInfo(1);
});
function LoadingInfo(page_index) {
	var search_text = $("#search_text").val();
	$.ajax({
		type : "post",
		url : "{:__URL('PLATFORM_MAIN/shop/arrivalguide')}",
		async : true,
		data : {
			"page_index" : page_index,  "search_text" : search_text
		},
		success : function(data) {
		//	alert(JSON.stringify(data));
			var html = '';
			$("#total_count_num").text(data["total_count"]);
			$("#page_count_num").text(data["page_count"]);
			$("#page_count").val(data["page_count"]);
			$("#pageNumber a").remove();
			if (data["data"].length > 0) {
				for (var i = 0; i < data["data"].length; i++) {
					html += '<tr align="center">';
					html += '<td><div class="cell"><label><input name="sub" type="checkbox" value="'+ data['data'][i]['guide_id']+'" ></label></div></td>';
					html += '<td class="right right-indent" title="'+data["data"][i]["sort"]+'">' + data["data"][i]["sort"]+ '</td>';
					html += '<td class="tal left" title="'+data["data"][i]["title"]+'">' + data["data"][i]["title"]+ '</td>';
					html += '<td></td>';
					html += '<td><a href="'+ __URL('PLATFORM_MAIN/shop/updateGuide?guide_id='+ data['data'][i]['guide_id'])+'">编辑</a></td> ';
					html += '</tr>';
				}
			} else {
				html += '<tr align="center"><td colspan="5">暂无入住指南数据</td></tr>';
			}
			$("#list").html(html);
			var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
			$("#pageNumber").append($html);
			load();
		}
	});
}	


</script>
{/block}